set(VK_SDK_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../extern/VulkanSDK)
set(VK_SDK_INCLUDE ${VK_SDK_PATH}/include)
set(VK_SDK_LIB ${VK_SDK_PATH}/lib/vulkan-1.lib)
# 设置一下VkLayer_khronos_validation的配置路径，不然这个验证层用不了
add_compile_definitions("LEARN_VK_LAYER_PATH=${VK_SDK_PATH}/bin")

file(GLOB HEADER_FILES include/*.h)
file(GLOB SOURCE_FILES src/*.cpp)

file(GLOB SHADER_FILES
    "shaders/glsl/*.vert"
    "shaders/glsl/*.frag"
)

add_executable(LearnVK ${HEADER_FILES} ${SOURCE_FILES})

target_sources(LearnVK PRIVATE ${SHADER_FILES})

target_link_libraries(LearnVK PRIVATE glm::glm)
target_link_libraries(LearnVK PRIVATE glfw)
target_link_libraries(LearnVK PRIVATE ${VK_SDK_LIB})

target_include_directories(LearnVK PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_include_directories(LearnVK PRIVATE ${VK_SDK_INCLUDE})

source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" 
    FILES 
        ${HEADER_FILES} 
        ${SOURCE_FILES}
        ${SHADER_FILES}
)